home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 273_01.zip / GETFSIZE.CC < prev    next >
Text File  |  1993-04-04  |  357b  |  16 lines

  1. #include <dir.h>
  2. long getfsize(char *fn)
  3. /* Return the filesize of a file.
  4.    char *fn is a pointer to the filespec.
  5.  
  6.    return = -1 if file is not found.
  7.    else returned will be the size of the file.
  8. */
  9. {
  10.         struct ffblk fb;
  11.         int rc;
  12.         rc=findfirst(fn,&fb,0);
  13.         if(rc==0) return(fb.ff_fsize);
  14.         return(-1);
  15. }
  16.